package com.matt.domain;

import com.matt.foundation.model.Domain;
import com.matt.foundation.model.Model;
import com.matt.foundation.model.UnionKey;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * *******************************
 * description：合同-产品
 * Created by Ron.
 * form com.matt
 * on 2018/6/13
 * *******************************
 */
@Entity
@Table(name = "contract_product")
@Data
@EqualsAndHashCode(callSuper = true)
public class ContractProduct extends Domain {

    @Transient
    private String productName;

    @Column(columnDefinition = "varchar(32)  COMMENT '产品id'")
    private String productId;

    @Column(columnDefinition = "varchar(32)  COMMENT '合同id'")
    private String contractId;

    @Column(columnDefinition = "varchar(32) COMMENT '客户id'")
    private String clienteleId;

//    @Column(columnDefinition = "int default 1 COMMENT '产品详情类型  1：  2： 3：'")
//    private Integer productDetailType;

    @Column(columnDefinition = "int default 1 COMMENT '类型 1:意向（转客户） 2：已购买（签合同）'")
    private Integer type;

    @Column(columnDefinition = "varchar(100) COMMENT '类型值'")
    private String typeVal;

    @Column(columnDefinition = "int default 1  COMMENT '产品类型  1：托班，2:早教，3：其它'")
    private Integer productType = 1;

    @Column(columnDefinition = "double default 0 COMMENT '数量'")
    private Double count;

    @Column(columnDefinition = "double default 0 COMMENT '剩余数量'")
    private Double remainCount=0d;

    @Column(columnDefinition = "decimal(12, 2) COMMENT '实际单位价格'")
    private BigDecimal practicalAmount = BigDecimal.ZERO;

    @Column(columnDefinition = "decimal(12, 2) COMMENT '实际总价格'")
    private BigDecimal practicalTotalAmount = BigDecimal.ZERO;

    @Column(columnDefinition = "decimal(12, 2) COMMENT '标准单位价格'")
    private BigDecimal standardAmount=BigDecimal.ZERO;

    @Column(columnDefinition = "decimal(12, 2) COMMENT '标准总价格'")
    private BigDecimal standardTotalAmount=BigDecimal.ZERO;

    @Column(columnDefinition = "longtext COMMENT '备注'")
    private String remark;

}
